#include "ParticleEditor.h"

#include "DescriptorContainer.h"
#include "DescriptorTool.h"
#include "ToolBase.h"
#include "Engine.h"


using namespace ParticleEngine;

ParticleEditor::ParticleEditor(Engine& NewEng, gui::StatusComponent& NewStatus) :
Status(NewStatus),
Eng(NewEng),
Tool(nullptr)
{
	Tool = Eng.Descriptors.GetToolDescriptor("Brush")->Instance(NewEng);
};

ParticleEditor::~ParticleEditor()
{
};

void ParticleEditor::SetToolType(std::string NewTool)
{
	ToolBase* ToolOld = Tool;
	Tool = Eng.Descriptors.GetToolDescriptor(NewTool)->Instance(Eng);
	if (ToolOld) delete ToolOld;
};